<?php
if(!defined('MY_ROOT'))
{throw new Exception('Access Denied');}
if($_G['uid']>0)
{header('Location: member.php?mod=info');}
$member=$_G['hwnd']['member'];
if(isset($_REQUEST['username']))
{
$ajax=($_REQUEST['inajax']==1) ? true : false;
$result=$member->login($_REQUEST['username'],$_REQUEST['password']);
if($result<0)
{
showmessage('error',_('login_err'),$ajax,'member.php?mod=login');
}else{
$return=(isset($_GET['go'])&&!$ajax) ? $_GET['go'] :'';
showmessage('success',_('login_success'),$ajax,$return);
}
}else{
$smarty=$_G['hwnd']['smarty'];
$smarty->display('member/login.tpl');
}
?>
